﻿BoxSportSystem.proveedoresList = (function() {
    var viewModel = kendo.observable({
        proveedoresDataSource: {},
        criterio: "",
        buscar: function(e) {
            onShow();
        },
        proveedor: {},
        selectProveedor: function(e) {
            this.set("proveedor", e.data);
            console.log(e.data);

        }
    });



    function onShow() {
        var criterio = viewModel.get("criterio");

        $.ajax({
            url: BoxSportSystem.config.urlServiceProveedor + "?criterio=" + criterio,
            dataType: "json",
            success: function(data) {
                viewModel.set("proveedoresDataSource", data);
            }
        });
    }

    return {
        onShow: onShow,
        viewModel: viewModel
        
    };
})(window);